package score;

import games.Game;

/**
 * Calcolatore di punteggio standard, che calcola il punteggio in base al tempo trascorso.
 * @author Jan
 *
 */
public class LinearCalculator extends ScoreCalculator {

	public LinearCalculator(Game currentGame) {
		super(currentGame);
	}

	private long elapsedTime;
	private long startTime;
	private float coeff = 0.02f;
	
	public void start() {
		startTime = System.currentTimeMillis();
		super.start();
	}
	
	@Override
	public long calculateScore() {
		elapsedTime = System.currentTimeMillis() - startTime;
//		return (long)( (float)(elapsedTime) * coeff);
		return (long) (elapsedTime*coeff);
	}
}
